<?php

class m110917_080006_init_auditable extends CDbMigration {
	public function safeUp() {
		$this
			->createTable('erp_auditable_log',
				array(
					'id' => 'pk',
					'userId' => 'int',
					'action' => 'int',
					'modelClass' => 'string',
					'modelId' => 'int',
					'change' => 'text',
					'time' => 'datetime'
				));
		$this->execute('ALTER TABLE  `erp_auditable_log` ENGINE = ARCHIVE;');
	}

	public function safeDown() {
		$this->dropTable('erp_auditable_log');
	}
}
